﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FrameworkLib.Configuration;
using System.Configuration;

namespace GestionePolveriImporter.Configuration
{
    [Serializable]
    [ConfigurationSectionNameAttribute("SettingElement")]
    public class SettingElement : FLibConfigurationElement
    {
        [ConfigurationProperty("workSheetName", IsKey=true, IsRequired = true)]
        public string WorkSheetName
        {
            get { return (string)base["workSheetName"]; }
            set { base["workSheetName"] = value; }
        }

        [ConfigurationProperty("startRow", IsKey = false, IsRequired = true)]
        public string StartRow
        {
            get { return (string)base["startRow"]; }
            set { base["startRow"] = value; }
        }

        [ConfigurationProperty("endRow", IsKey = false, IsRequired = true)]
        public string EndRow
        {
            get { return (string)base["endRow"]; }
            set { base["endRow"] = value; }
        }

        [ConfigurationProperty("description", IsRequired = true)]
        public string Description
        {
            get { return (string)base["description"]; }
            set { base["description"] = value; }
        }

        [ConfigurationProperty("Maps", IsDefaultCollection = false),
         ConfigurationCollection(typeof(FLibConfigurationCollection<MapElement>), AddItemName = "add", ClearItemsName = "clear", RemoveItemName = "remove")]
        public FLibConfigurationCollection<MapElement> Maps
        {
            get { return (FLibConfigurationCollection<MapElement>)this["Maps"]; }
        }
    }
}
